<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>轮播图</title>
<link href="css/style2.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function previewFile() {
		var preview = document.getElementById('view_image');
		var file = document.querySelector('input[type=file]').files[0];
		var reader = new FileReader();
		reader.onloadend = function() {
			preview.src = reader.result;
		}
 
		if (file) {
			reader.readAsDataURL(file);
		} else {
			preview.src = "";
		}
	}
</script>
</head>
<body>

	<div class="formbody">
		<div class="formtitle">
			<span>轮播图</span>
		</div>
		<ul class="forminfo">
			<form action="MainPicture_editTopRotationMap" method="post" enctype="multipart/form-data">
				<li>
					<label>选择图片：</label> 
					<img id="view_image" src="images/${mainPicture.picture }" height="200" alt="Image preview..."/>
						<br/> <label>&nbsp;</label>
						<input class="selectfile"
							type="file" onchange="previewFile()" name="file"/>
						<br/>
				</li>
				<ul style="float: left; display: inline">
					<li style="display: inline"><a href=""
						target="rightFrame" /> <input name="" type="submit" class="btn"
						value="确认" /></li>
					</li>
				</ul>
				<input name="id" value="${mainPicture.id }" type="hidden" />
			</form>
		</ul>
	</div>
</body>
</html>
